using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class TipMap : EntityTypeConfiguration<Tip>
    {
        public TipMap()
        {
            // Primary Key
            this.HasKey(t => t.tip_id);

            // Properties
            this.Property(t => t.tip_head)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("Tips");
            this.Property(t => t.tip_id).HasColumnName("tip_id");
            this.Property(t => t.tip_head).HasColumnName("tip_head");
            this.Property(t => t.tip_content).HasColumnName("tip_content");
        }
    }
}
